package com.xuanwei.core.enums;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/7/11 17:06
 **/
public enum RefundStatus {

    APPLAYING(0, "申请中"),
    AGREE(1, "同意退款"),
    REJECT(2, "拒绝退款"),
    REFUNDING(3, "退款中"),
    REFUND_SUCCESS(4, "退款成功"),
    GO_ON_ORDER(5, "用户选择继续订单");

    private Integer code;

    private String msg;

    RefundStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMessage(Integer code) {
        RefundStatus[] values = values();
        for (RefundStatus refundStatus : values) {
            if (refundStatus.getCode().equals(code)) {
                return refundStatus.getMsg();
            }
        }
        return "";
    }
}
